package com.meatball.data.entity

import io.swagger.v3.oas.annotations.media.Schema
import jakarta.persistence.Entity
import jakarta.persistence.GeneratedValue
import jakarta.persistence.GenerationType
import jakarta.persistence.Id
import jakarta.validation.constraints.NotBlank
import org.springframework.data.annotation.CreatedDate
import org.springframework.data.annotation.LastModifiedDate
import java.time.LocalDateTime

/**
 * 关键词匹配模式实体
 * @author 张翔宇
 * @since 2023年11月29日
 */
@Schema(description = "关键词匹配模式实体")
@Entity(name = "ANTI_STOP")
data class AntiStopEntity(
    @field:Schema(description = "ID")
    @field:Id
    @field:GeneratedValue(strategy = GenerationType.AUTO)
    @field:NotBlank(message = "id不能为空")
    var id: String? = null,

    @field:Schema(title = "关键词一", description = "多个词语请用#隔开", example = "当前#本月#本周#本年")
    @field:NotBlank(message = "关键词一不能为空")
    var keyword1: String? = null,

    @field:NotBlank(message = "关键词二不能为空")
    var keyword2: String? = null,

    var hasPrefix: Boolean? = null,

    @field:NotBlank(message = "回答不能为空")
    var answer: String? = null,
    var command: String? = null,

    @field:CreatedDate
    var createTime: LocalDateTime? = null,

    @field:LastModifiedDate
    var updateTime: LocalDateTime? = null
)
